<template>
  <el-input
    v-model="form.number"
    @input="handleInput"
    placeholder="请输入数字"
  ></el-input>
</template>

<script lang="ts" setup>
import { reactive } from 'vue';

const form = reactive({
  number: ''
});

const handleInput = (val: string) => {
  form.number = val.replace(/\D/g, '');
};
</script>
